using System;
using Sce.PlayStation.Core;

namespace Nyanimals
{
    /// <summary>
    /// Base class for objects that are selectable in the world.
    /// I.E signs, terminals, etc
    /// </summary>
    public class CFoodBin : CBaseSelectable
    {
        public CFoodBin() : base()
        { 
            
        }
  
        #region implemented abstract members of Nyanimals.CBaseObject
        public override void Init()
        {
            int meshIndex = CMeshManager.Instance.LoadMesh("foodbox.SRM");                 
            int contextIndex = CContextManager.Instance.AddStaticContext(meshIndex, Matrix4.Identity);
            context = (CStaticContext)CContextManager.Instance.GetContext(contextIndex);
            collision = new CollisionBox(Vector3.Zero, 1.8f, 2.0f, 1.8f);
            
            context.WireFrame = true;
        }

        public override void Shutdown()
        {
            CContextManager.Instance.RemoveContext(context);
            context = null;
        }

        public override void Input()
        {
        }

        public override void Update(float deltaTime)
        {
            collision.Position = WorldMatrix.AxisW;
        }

        public override bool HandleCollision(ref CBaseObject Obj)
        {
            return false;
        }
        
        public override void HandleCommunication(CBaseObject obj)
        {
            Console.WriteLine("Food bin Activated!");
        }
        
        public override SelectableTypes SelectableType
        {
            get { return SelectableTypes.FoodBox_Selectable;}
        }
        #endregion
    }
}

